#ifndef CAMERAPOSITION_H
#define CAMERAPOSITION_H

using namespace irr;

using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

class CameraPosition{
	double X, Y, Z;
	double R;
	double angle;
public:
	CameraPosition(){
		X=Z=angle=0;
		R=Y=50;
	}
	CameraPosition(double x, double y, double z){
		X=x, Y=y, Z=z;
		R=sqrt(x*x+y*y);
		angle=((x==0)? 0:(y==0? PI/2: atan(x/y)));
	}
	core::vector3df pos(){
		return core::vector3df(X, Y, Z);
	}
	double getX(){
		return X;
	}
	double getY(){
		return Y;
	}
	double getZ(){
		return Z;
	}
	double getR(){
		return R;
	}
	double getAngle(){
		return angle;
	}

	void IncreaseR(double delta){
		R += delta;

		//angle=((X==0)? 0:(Y==0? PI/2: atan(X/Y)));
		X = R * cos(angle);
		Y = R * sin(angle);
		//if(R<40) IncreaseY(-delta);
	}

	void Rotate(double delta){
		angle+=delta/60;
		if(angle>2*PI) angle-=2*PI;
		else if(angle<0) angle+=2*PI;
		X=R*cos(angle);
		Y=R*sin(angle);
	}
};

#endif